<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-form>
  <div class="aui-gutter-column-xl">
    <lv-form-column lvWidth="14%">
      <ng-container *ngIf="!isInstance">
        <ng-container
          *ngIf="
            data?.linkStatus ===
            dataMap.resource_LinkStatus_Special.normal.value
          "
        >
          <i lv-icon="aui-icon-detail-cluster" class="cluster-icon"></i>
        </ng-container>
        <ng-container
          *ngIf="
            data?.linkStatus ===
            dataMap.resource_LinkStatus_Special.offline.value
          "
        >
          <i
            lv-icon="aui-icon-summary-cluster-offline"
            class="cluster-icon"
          ></i>
        </ng-container>
      </ng-container>
      <ng-container *ngIf="isInstance">
        <ng-container
          *ngIf="
            data?.linkStatus ===
            dataMap.resource_LinkStatus_Special.normal.value
          "
        >
          <i lv-icon="aui-icon-instance-online" class="cluster-icon"></i>
        </ng-container>
        <ng-container
          *ngIf="
            data?.linkStatus ===
            dataMap.resource_LinkStatus_Special.offline.value
          "
        >
          <i lv-icon="aui-icon-instance" class="cluster-icon"></i>
        </ng-container>
      </ng-container>
    </lv-form-column>
    <ng-container *ngFor="let forms of formItems">
      <lv-form-column [lvWidth]="forms[0].key === 'parentName' ? '32%' : '20%'">
        <lv-form-item *ngFor="let item of forms">
          <lv-group>
          <lv-form-label class="no-margin-box">
            {{ item.label | i18n }}
          </lv-form-label>
            <lv-form-control class="value">
             <span lv-overflow style="width: 120px">
               {{ item.value | nil }}
             </span>
            </lv-form-control>
          </lv-group>
        </lv-form-item>
      </lv-form-column>
    </ng-container>
  </div>
  <div class="aui-header-2 aui-gutter-column-md">
    <h2>{{ 'system_servers_label' | i18n }}</h2>
  </div>
  <lv-pro-table
    #dataTable
    [config]="tableConfig"
    [data]="tableData"
  ></lv-pro-table>
</lv-form>
